<?php
header("Refresh:1 ;url=./add4.php");

$type_name = $_REQUEST['type_name'];

include "db.php";
$sql = "insert into dish_type(type_name) values('$type_name')";
$sqlo = $conn->prepare($sql);
$ok = $sqlo->execute();

if (isset($type_name) && empty($type_name)) {
    exit('请插入类型');
}
if($ok) {
    exit('插入成功');
}else{
    exit('插入失败');
}